define(['text!./addInfo.html', 'css!./addInfo.css'], function( html) {
	avalon.templateCache['addInfo']=html;
	var vm = avalon.define({
	    $id: "addInfo",
	    name:'',
	    phone:'',
	    tel:'',
	    detailInfo:function(){
	    	if(!vm.name){
	    		msgbox('提示','请输入家人的昵称');
	    		return;
	    	}
	    	if(!vm.phone){
	    		msgbox('提示','请输入家人的手机号或者座机号');
	    		return;
	    	}
	    	var family={
	    		name:vm.name,
	    		phone:vm.phone,
	    		tel:vm.tel
	    	}
	    	setstorage('family',family);
	    	Router.go('/detailInfo/detailInfo');
	    },
	    back:function(){
	    	clearstorage('family');
	    	Router.go('/Home/Home');
	    },
	    init:function(){
	    	if(getstorage('family')){
	    		var user=JSON.parse(getstorage('family'));
	    		vm.name=user.userName;
	    		vm.phone=user.phone;
	    		vm.tel=user.tel;
	    	}else{
	    		vm.name="";
	    		vm.phone="";
	    		vm.tel="";
	    	}
	    }
  });
});